# Contributor: Jonas <3426-spameier@users.gitlab.alpinelinux.org>
# Maintainer: Jonas <3426-spameier@users.gitlab.alpinelinux.org>
pkgname=nmap-parse-output
pkgver=1.5.1
pkgrel=0
pkgdesc="Converts/manipulates/extracts data from a Nmap scan output."
url="https://github.com/ernw/nmap-parse-output"
arch="noarch"
license="BSD-3-Clause"
depends="bash libxslt"
subpackages="$pkgname-bash-completion $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ernw/nmap-parse-output/archive/v$pkgver.tar.gz"
options="!check"

package() {
	install -Dm 755 -t "$pkgdir/usr/share/$pkgname/" nmap-parse-output
	install -Dm 644 -t "$pkgdir/usr/share/$pkgname/nmap-parse-output-xslt/" nmap-parse-output-xslt/*
	install -dm 755 "$pkgdir/usr/bin"
	ln -sf "/usr/share/$pkgname/$pkgname" "$pkgdir/usr/bin/$pkgname"

	# bash-completion
	install -Dm 644 _nmap-parse-output "$pkgdir/usr/share/bash-completion/completions/nmap-parse-output"

	# doc
	install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
	install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" demo.gif
	install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
	install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/" ThirdPartyNotices.md
}

sha512sums="
460705435905bf08f71c66af107c453ee3090d3f9e9381417e78d13811f22646e76fa311718e88f75083756b4d368431d7c47df0747031d5631fe63fcbf77726  nmap-parse-output-1.5.1.tar.gz
"
